import React, { Component } from 'react'
import { connect } from 'react-redux'

export class Car extends Component {
    render() {
        let { add } = this.props

        return (
            <div>
                {
                    add.map((item, index) => {
                        return <ul key={index}>
                            <img src={item.img} />
                            <li>{item.name}</li>
                        </ul>
                    })
                }
            </div>
        )
    }
}

const mapStateToProps = (state) => {
    let { add } = state
    return {
        add
    }
}

const mapDispatchToProps = () => {
    return {}
}

export default connect(mapStateToProps, mapDispatchToProps)(Car)
